package com.ssy.lingxi.order.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

/**
 * 送货外部流转记录状态枚举
 * @author czh
 * @version 2.0.0
 * @date 2022-02-24
 */
public enum DeliveryHistoryStatusEnum {

    WAIT_SUBMIT(1, "待提交"),

    WAIT_CONFIRM(2, "待确认"),

    WAIT_MODIFY(3, "待修订"),

    ALREADY_CONFIRM(4, "已确认"),

    CREATE_DELIVERY_ORDER(5, "已生成送货单"),

    INVALID(6, "已作废"),

    ALREADY_SUBMIT(7, "已提交"),

    RECEIVED(8, "已收货");

    DeliveryHistoryStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    private Integer code;
    private String name;

    /**
     * 根据外部状态枚举值获得外部状态名称
     * @param code 外部状态枚举值
     * @return 外部状态名称
     */
    public static String getNameByCode(Integer code) {
        return LanguageHolder.getName(DeliveryHistoryStatusEnum.class, code);
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
